home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols sprited:1.4.1;
- locks ; strict;
- comment @ * @;
-
-
- 1.4
- date 88.07.29.17.40.26; author ouster; state Exp;
- branches 1.4.1.1;
- next 1.3;
-
- 1.3
- date 88.07.28.17.29.06; author ouster; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 88.07.25.10.37.24; author ouster; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 88.06.19.14.31.37; author ouster; state Exp;
- branches ;
- next ;
-
- 1.4.1.1
- date 91.11.27.13.13.33; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.4
- log
- @Lint.
- @
- text
- @/*
- * lseek.c --
- *
- * Procedure to map from Unix access system call to Sprite.
- *
- * Copyright 1986 Regents of the University of California
- * All rights reserved.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: lseek.c,v 1.3 88/07/28 17:29:06 ouster Exp $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <sprite.h>
- #include "compatInt.h"
- #include <fs.h>
- #include <sys/file.h>
- #include <errno.h>
-
-
- /*
- *----------------------------------------------------------------------
- *
- * lseek --
- *
- * procedure for Unix lseek call.
- *
- * Results:
- * the old offset if the IOC_Reposition call was successful.
- * UNIX_ERROR is returned if IOC_Reposition failed.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
- long
- lseek(filedes, offset, whence)
- int filedes; /* array of stream identifiers */
- long offset;
- int whence;
- {
- ReturnStatus status;
- int base;
- int newOffset;
-
- switch(whence) {
- case L_SET:
- base = IOC_BASE_ZERO;
- break;
- case L_INCR:
- base = IOC_BASE_CURRENT;
- break;
- case L_XTND:
- base = IOC_BASE_EOF;
- break;
- default:
- errno = EINVAL;
- return(UNIX_ERROR);
- }
- status = Ioc_Reposition(filedes, base, (int) offset, &newOffset);
- if (status != SUCCESS) {
- errno = Compat_MapCode(status);
- return(UNIX_ERROR);
- } else {
- return(newOffset);
- }
- }
- @
-
-
- 1.4.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d11 1
- a11 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/unixSyscall/RCS/lseek.c,v 1.4 88/07/29 17:40:26 ouster Exp $ SPRITE (Berkeley)";
- @
-
-
- 1.3
- log
- @Change parameters to match UNIX.
- @
- text
- @d11 1
- a11 1
- static char rcsid[] = "$Header: lseek.c,v 1.2 88/07/25 10:37:24 ouster Exp $ SPRITE (Berkeley)";
- d62 1
- a62 1
- status = Ioc_Reposition(filedes, base, offset, &newOffset);
- @
-
-
- 1.2
- log
- @Must declare lseek "long" (even though manual says "int").
- @
- text
- @d11 1
- a11 1
- static char rcsid[] = "$Header: lseek.c,v 1.1 88/06/19 14:31:37 ouster Exp $ SPRITE (Berkeley)";
- d41 1
- a41 1
- int offset;
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d11 1
- a11 1
- static char rcsid[] = "$Header: lseek.c,v 1.4 87/06/25 17:39:49 deboor Exp $ SPRITE (Berkeley)";
- d38 1
- a38 1
- int
- @
-